﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;

using ERPStore.Extensions;

namespace ERPStore.Indexers.Lucene.Services
{
	public class EndApplicationRequestedEventMessage : ERPStore.Services.IConsumer<ERPStore.Events.EndApplicationRequestedEvent>
	{
		public EndApplicationRequestedEventMessage()
		{

		}

		#region IConsumer<EndApplicationRequestedEvent> Members

		public void Handle(Events.EndApplicationRequestedEvent eventMessage)
		{
			var worker = GlobalConfiguration.Configuration.DependencyResolver.GetService<Services.IndexBuilder>();
			worker.Stop();
		}

		#endregion
	}
}
